//
//  CartFooterView.m
//  StandardizedProduct
//
//  Created by 宁宁 on 16/6/28.
//  Copyright © 2016年 ym. All rights reserved.
//

#import "CartFooterView.h"

@implementation CartFooterView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self setView];
    }
    return self;
}

- (void)setView{
    //全选按钮
    _chooseBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    _chooseBtn.frame = CGRectMake(0, 0, 40, self.frame.size.height);
    _chooseBtn.backgroundColor = [UIColor clearColor];
    [self addSubview:_chooseBtn];
    
    //全选图片
    _chooseImage = [[UIImageView alloc] initWithFrame:CGRectMake(12, 14, 16, 16)];
    _chooseImage.image = [UIImage imageNamed:@"GLDZicon_13"];
    _chooseImage.layer.cornerRadius = 8;
    _chooseImage.layer.masksToBounds = YES;
    [self addSubview:_chooseImage];
    
    //全选Label
    UILabel *chooseAll = [[UILabel alloc] initWithFrame:CGRectMake(7, 35, 26, 16)];
    chooseAll.text = @"全选";
    chooseAll.font = [UIFont systemFontOfSize:13];
    chooseAll.textColor = [UIColor grayColor];
    [self addSubview:chooseAll];
    
    //结算按钮
    _settlement = [UIButton buttonWithType:UIButtonTypeCustom];
    _settlement.frame = CGRectMake(self.frame.size.width - 88, 10, 80, 34);
    _settlement.backgroundColor = APPCOLOR;
    [_settlement setTitle:@"结算" forState:UIControlStateNormal];
    [_settlement setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    _settlement.titleLabel.font = [UIFont systemFontOfSize:15];
    _settlement.layer.cornerRadius = 5;
    _settlement.layer.masksToBounds = YES;
    [self addSubview:_settlement];
    
    //合计
    _total = [[UILabel alloc] initWithFrame:CGRectMake(40, 10, self.frame.size.width - 136, 16)];
    _total.text = @"合计: ¥ 0";
    _total.textAlignment = NSTextAlignmentRight;
    _total.font = [UIFont systemFontOfSize:13];
    [self addSubview:_total];
    
    //不含运费
    UILabel *freight = [[UILabel alloc] initWithFrame:CGRectMake(self.frame.size.width - 140, 34, 44, 14)];
    freight.text = @"不含运费";
    freight.textColor = [UIColor grayColor];
    freight.font = [UIFont systemFontOfSize:11];
    [self addSubview:freight];
}

@end
